#ifndef __LOGIC_H
#define __LOGIC_H

#include "map.h"
#include "player.h"

extern int game_time; // in ticks passed since game start

// Set the damage_handler after calling logic_reset(). 
// When the game logic detects a hit with a weapon, this function is called.
extern void (*damage_handler) (int time, coord_t where, int attacker, int victim, int weapon, int damage);

extern void logic_reset ();
extern void logic_update (Map* map);
extern void logic_enqueue (const Action* action);
extern int action_is_valid (Map* map, const Action* action);
extern int time_asap (Player* actor);

#endif
